-- 菜单 SQL
insert into sys_menu (pid, i_frame, title, app_module_id, component, menu_sort, icon, path, cache, hidden, name, create_time, permission, type, open_type, sub_count, update_by, create_by, update_time)
values(000, 0, '${apiAlias}管理', 000, '${changeClassName}/index', 999, 'menu', '${changeClassName}', 0, 0, '${className}', '${date}', '${changeClassName}:list', 1, 0, 0, null, null, '${date}');

-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
SELECT @appModuleId = app_module_id from ${tableName} where id = @parentId

-- 按钮 SQL
insert into sys_menu (pid, i_frame, title, app_module_id, component, menu_sort, icon, path, cache, hidden, name, create_time, permission, type, open_type, sub_count, update_by, create_by, update_time)
values(@parentId, 0, '${apiAlias}新增', @appModuleId, '', 999, '', '', 0, 0, '', '${date}', '${changeClassName}:add', 2, 0, 0, null, null, '${date}');

insert into sys_menu (pid, i_frame, title, app_module_id, component, menu_sort, icon, path, cache, hidden, name, create_time, permission, type, open_type, sub_count, update_by, create_by, update_time)
values(@parentId, 0, '${apiAlias}修改', @appModuleId, '', 999, '', '', 0, 0, '', '${date}', '${changeClassName}:edit', 2, 0, 0, null, null, '${date}');

insert into sys_menu (pid, i_frame, title, app_module_id, component, menu_sort, icon, path, cache, hidden, name, create_time, permission, type, open_type, sub_count, update_by, create_by, update_time)
values(@parentId, 0, '${apiAlias}删除', @appModuleId, '', 999, '', '', 0, 0, '', '${date}', '${changeClassName}:del', 2, 0, 0, null, null, '${date}');
